// pages/home/search/components/designer-item/index.js
const app = getApp()
Component({
  properties: {
    userInfo: {
      type: Object,
      value: null
    }
  },
  lifetimes: {
    attached() {
      if (this.properties.userInfo) {
        this.properties.userInfo.Score = this.properties.userInfo.Score?.toFixed(1)
        this.setData({
          userData: this.properties.userInfo
        })
      }
      // console.log('装修工人',this.data.userData);
    }
  },
  data: {
    IMGBASEURL: app.globalData.IMGBASEURL,
    userData: null
  },

  /**
   * 组件的方法列表
   */
  methods: {
    // 跳转用户主页
    goPage() {
      // console.log('跳转用户主页',this.data.userData);
      // return 
      wx.navigateTo({
        url: `/pages/my/othersPage/index?code=${this.data.userData.UserCode}`,
      })
    },
  }
})